package com.example.qguserprovider.controller;

import com.example.qgcommon.util.ReturnUtil;
import com.example.qguserprovider.service.UserService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

@RestController
public class UserController {
    @Resource
    private UserService service;

    @RequestMapping("/login")
    public Map login(@RequestParam Map map){

//        System.out.println("UserController:"+map);

        return  service.getByPhonePwd( map );

//        System.out.println("byPhonepwd:"+user);
//        if (user == null){
//            return ReturnUtil.fail();
//        }else{
//            try{
//
//            }catch (Exception e){
//
//            }
//            return ReturnUtil.success(user);
//        }

    }
    @RequestMapping("/getByPhone")
    public Map getByPhone(@RequestParam("phone") String phone){
        return service.getByPhone( phone );
    }

}
